// DSTapeRemoveView.h : interface of the CDSTapeRemoveView class
//
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INCLUDES()
#include "Util/msflexgrid.h"
//}}AFX_INCLUDES

#if !defined(AFX_DSTapeRemoveVIEW_H__77651E88_693E_4EF0_A538_9BB3073ADB58__INCLUDED_)
#define AFX_DSTapeRemoveVIEW_H__77651E88_693E_4EF0_A538_9BB3073ADB58__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include ".\Util\MinButton.h"
#include ".\Util\MinLabel.h"
#include ".\Util\MinDigital.h"
#include ".\Util\SxGroupBox.h"
// Hardware Layer
class IIO;
class IOnLine;
class CXGem;
// Process Layer
class IAutoManager;
class ITrsRobotBuffer;
class ITrsTapeRemover;
class ITrsLoaderPort;

class IRobotBuffer;
class ITapeRemover;
class ILoaderPort;


// Common Layer
class CSystemData;
class CErrorCodeData;
class CDSTapeRemoveDoc;
class CModelData;
class CMappingData;
class COnLine;
class CUVLightData;

class CDSTapeRemoveView : public CFormView
{
private:
	IIO* m_lnkIO;
	BOOL m_bErrorDisplay;
	BOOL m_flgFosbCheck;
	

protected: // create from serialization only
	CDSTapeRemoveView();
	DECLARE_DYNCREATE(CDSTapeRemoveView)

public:
	//{{AFX_DATA(CDSTapeRemoveView)
	enum { IDD = IDD_DSTAPEREMOVE_FORM };
	CMinButton	m_bWaferJob;
	CMinButton	m_bQuit;
	CMinButton	m_bTableChange;
	CMinButton	m_bErrorList;
	CMinButton	m_bTapeChange;
	CMinButton	m_bCutterChange;
	CMinButton	m_bSettingMode;
	CMinButton	m_bRunMode;
	CMinButton	m_bOrigin;
	CMinButton	m_bModelChange;
	CMinButton	m_bManualMode;
	CMinButton	m_bMainMode;
	CMinButton	m_bDataMode;
	CMinButton	m_bCycleStop;
	CMinButton	m_bAutoStop;
	CMinButton	m_bAutoStart;
	CMinButton	m_bAutoInit;
	CMSFlexGrid	m_gridModelInfo;
	CMSFlexGrid	m_gridSystemInfo;
	CMSFlexGrid	m_gridProcductInfo;
	//}}AFX_DATA

// Attributes
public:
	CDSTapeRemoveDoc* GetDocument();
	void Draw1();
	void Draw2();
	void Draw3();
	void Draw4();
	void Draw5();
	void Draw6();
	void Draw7();
	void Draw8();
	void ErrorDisplay(int nErrorCode);

	void PeekAndPump();
	void DisplayMachineTact(CString strTact);
	CMinLabel	m_sHiCheck[25];
	BOOL m_flgMappingData[25];
	int iWorkPosData[25];
	int Control_State;

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDSTapeRemoveView)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CDSTapeRemoveView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif
	
protected:
	void MoveWafer();
	void LabelInitial();
	void ButtonInitial();
	void DisplayOpMode();
	void GridInitial();
	void UVOnWaitTime();
	void UVOffWaitTime();
	void UVTotalTime(); 
	

	IAutoManager* m_lnkAutoManager;
	ITrsRobotBuffer* m_lnkTrsRobotBuffer;
	ITrsTapeRemover* m_lnkTrsTapeRemover;
	ITrsLoaderPort* m_lnkTrsLoaderPort;

	
	IRobotBuffer* m_lnkRobotBuffer;
	ITapeRemover* m_lnkTapeRemover;
	ILoaderPort* m_lnkLoaderPort;

	CErrorCodeData* m_lnkErrorCodeData;
	CDSTapeRemoveDoc* m_pDoc;
	CSystemData* m_lnkSystemData;
	CModelData* m_lnkModelData;
	CUVTimeData* m_lnkUVTotalTime;

	CMappingData* m_lnkMappingData;
	CXGem* m_lnkOnLine;

	UINT m_nTimerID;
	BOOL m_TimerInitFlag;
	BOOL m_fDoor1;
	BOOL m_fDoor2;
	BOOL m_fDoor3;
	BOOL m_fDoor4;
	BOOL m_fDoor5;
	BOOL m_fDoor6;
	BOOL m_fDoor7;
	BOOL m_fDoor8;
	int m_fMovewafer;

	BOOL m_flgUVOnStart;
	BOOL m_flgUVOffStart;
	BOOL m_flgUVOn;
	BOOL m_flgHTOn;
	BOOL m_flgUVTimeStart;

// Generated message map functions
protected:
	//{{AFX_MSG(CDSTapeRemoveView)
	afx_msg void OnQuitBtn();
	afx_msg void OnMainmode();
	afx_msg void OnDatamode();
	afx_msg void OnManualmode();
	afx_msg void OnSettingmode();
	afx_msg void OnPaint();
	afx_msg void OnModelChange();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnDestroy();
	afx_msg void OnAutoInit();
	afx_msg void OnOrigen();
	afx_msg void OnRunMode();
	afx_msg void OnAutoStart();
	afx_msg void OnAutoStop();
	afx_msg void OnCycleStop();
	afx_msg void OnStepStop();
	afx_msg void OnCutterChange();
	afx_msg void OnTapeChange();
	afx_msg void OnClickGridSystemInfo();
	afx_msg void OnErrorList();
	afx_msg void OnClickGridProductionInfo();
	afx_msg void OnTableChange();
	afx_msg void OnWaferJob();
	DECLARE_EVENTSINK_MAP()
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in DSTapeRemoveView.cpp
inline CDSTapeRemoveDoc* CDSTapeRemoveView::GetDocument()
   { return (CDSTapeRemoveDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DSTapeRemoveVIEW_H__77651E88_693E_4EF0_A538_9BB3073ADB58__INCLUDED_)
